#!/usr/bin/python
#coding=utf-8

import ctypes

so = ctypes.CDLL("../api/libupdDispatchApi.so")

dspIp="192.168.154.128"
dspPort=5001
service="updServer"
srvIp=ctypes.c_buffer(16)
psrvIp=ctypes.pointer(srvIp);
srvPort=ctypes.c_short()
psrvPort=ctypes.pointer(srvPort)

if -1 == so.dspGetService(dspIp, dspPort, service, srvIp, psrvPort):
	print "error"
else:
	print "updServer:"
	print " ip:" + srvIp.value
	print " port:%d" % srvPort.value
